import axios from 'axios'
let condition = process.env.NODE_ENV;
console.log('condition', condition)
const instance = axios.create({
    baseURL: condition == 'production' ? "/" : '/api'
})
console.log(instance.baseURL);
const HTTP = {
    get(url, data, headers) {
        return instance.get(url, {
            params: data,
            headers
        })
    },
    post(url, data, headers) {
        return instance.post(url, data, {
            headers
        })
    },

    delete(url, data, headers) {
        return instance.delete(url, {
            params: data,
            headers
        })
    },
}
export default {
    install(app) {
        app.config.globalProperties.$http = HTTP;
    }
}